import Vue from 'vue';
import VueRouter from 'vue-router';
import HomeView from '../views/HomeView.vue';
import NotFound from '../Notfound.vue';
const apiName = window.__POWERED_BY_QIANKUN__ ? '/mappdm' : '';

Vue.use(VueRouter);

let routes = [
  {
    path: '/',
    name: 'home',
    redirect: 'demo'
  },
  {
    path: `${apiName}/demo`,
    name: 'demo',
    component: HomeView
  },
  {
    path: '*',
    name: 'notfound',
    component: NotFound
  }
];

const router = new VueRouter({
  routes
});

export default router;
